package com.david;

import org.flowable.engine.ProcessEngine;
import org.flowable.engine.ProcessEngineConfiguration;
import org.flowable.engine.impl.cfg.StandaloneProcessEngineConfiguration;
import org.springframework.beans.factory.annotation.Value;

public class MainFlowableClient {
    /**
     * 执行引擎（现成安全的对象，在一个应用中只需要初始化一次）
     */

    private static final ProcessEngine processEngine;

    static {
        // 单机处理引擎配置信息实例
        StandaloneProcessEngineConfiguration cfg = new StandaloneProcessEngineConfiguration();
        // &nullCatalogMeansCurrent=true 必须增加在url后，否则建表失败
        cfg.setJdbcUrl("jdbc:mysql://23kv52kb9215.vicp.fun:31465/industry?serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true");
        cfg.setJdbcUsername("root");
        cfg.setJdbcDriver("com.mysql.cj.jdbc.Driver");
        cfg.setJdbcPassword("Geyadong@123");
        cfg.setDatabaseSchemaUpdate(ProcessEngineConfiguration.DB_SCHEMA_UPDATE_TRUE);

        // 通过配置获取执行引擎
        processEngine = cfg.buildProcessEngine();
    }

    public static void main(String[] args) {
        System.out.println(processEngine);
    }

}
